<template>
	<view class="content">
		<NAVC class="top" title='锦鲤客服' />
		<web-view style="margin-top: 44px; background-color: #fff" :webview-styles="webviewStyles" :src="urlType"
			></web-view>
	</view>
</template>

<script lang="ts" setup>
	import NAVC from '@/components/equipmentC/navC/index.vue'
	import { onLoad } from '@dcloudio/uni-app';
	import { ref } from 'vue';
	const urlType= ref("http://103.148.59.132:10000/chatIndex?kefu_id=koi")
	   const webviewStyles = ref({
		progress: {
			color: "#FF3333"
		}
	})
	onLoad(()=> {
		// #ifdef APP-PLUS
		let height = 0; //定义动态的高度变量
		let statusbar = 0; // 动态状态栏高度
		uni.getSystemInfo({
			// 获取当前设备的具体信息
			success: sysinfo => {
				statusbar = sysinfo.statusBarHeight;
				height = sysinfo.windowHeight;
			}
		});
		let currentWebview = this.$scope.$getAppWebview(); //获取当前web-view
		setTimeout(function () {
			var wv = currentWebview.children()[0];
			wv.setStyle({
				//设置web-view距离顶部的距离以及自己的高度，单位为px
				top: statusbar + uni.upx2px(44), //此处是距离顶部的高度，应该是你页面的头部
				height: height - statusbar - uni.upx2px(44), //webview的高度
				scalable: false, //webview的页面是否可以缩放，双指放大缩小,
			});
		}, 200); //如页面初始化调用需要写延迟
		// #endif
	})
</script>

<style lang="scss" scoped>
	.content {
		height: 100vh;

		.top {
			position: relative;
		}
	}
</style>